PGetTypeStyle

Gets the type style of the highlighted text.


Query results

short nMask;
The sum of all the type styles that are applied to every highlighted character, plus the sum of the styles that are not applied to any of the characters. The value of each type style is:
0 for conflicting settings in selection
1 for Normal
2 for Bold
4 for Italic
8 for Underline
16 for Strikethru
32 for Outline (Macintosh only)
64 for Shadow (Macintosh only)
128 for Reverse
short nApplied;
The sum of the type styles that are applied to every highlighted character.
1 for Normal
2 for Bold
4 for Italic
8 for Underline
16 for Strikethru
32 for Outline (Macintosh only)
64 for Shadow (Macintosh only)
128 for Reverse
nMask and nApplied. The text within a highlighted range often has a number of different type styles applied to it. This query returns a mask/applied pair to indicate which type styles it can provide information about (those applied or not applied uniformly across the selection) and which of those styles are actually applied to the text. The type styles not included in nMask are styles that are applied to some, but not all, the characters.

For example, if all of the selected text has the same type styles applied to it (something other than Normal), nMask equals 254 (the total of all the settings except Normal). nApplied would indicate which type styles were actually applied to the text.

Using another example, if nMask equals 14 (the sum of the Bold, Italic, and Underline values), then the only styles PageMaker can provide information about are Bold, Italic, and Underline. Since the mask values of Strikethru, Outline, Shadow, and Reverse are not included in the sum, some of the text may have these attributes applied to it, and some may not.

If nApplied for this same text equals 6 (the sum of the Bold and Italic values), all of the selected text has Bold and Italic applied to it and none of the text has Underline applied.

Defining and editing a style. If you are defining or editing a style using the PStyleBegin command, PageMaker gets the type style for that style definition rather than for the selected text.

No insertion point. If the text does not contain the insertion point, PageMaker gets the default type style.

No text selected. If the text contains the insertion point but no text is selected, PageMaker returns the type style of the character preceding the inser tion point. If the insertion point is before the first character of the story, PageMaker returns the type style of the first character.

Finding and changing type styles. If you are using the PGetTypeStyle query in conjunction with PChangeTypeAttr1, PFindTypeAttr1, PGetChangeTypeAttr1, or PGetFindTypeAttr1, note that the PGetTypeStyle query returns different values for the type styles. With the exception of normal, all the PGetTypeStyle values are twice the values used in the find and change commands and queries. For example, bold is 2 for PGetTypeStyle and 1 for PChangeTypeAttr1, PFindTypeAttr1, PGetChangeTypeAttr1, and PGetFindTypeAttr1. Normal, however, is 1 in PGetTypeStyle and 0 in the other commands and queries.


See also

The PTypeStyle command


Copyright © 1996, Adobe Systems Incorporated. All rights reserved.

Comments or suggestions? Contact Adobe Developer Support